/**
 * 字段属性常量
 * @author luolin
 */
const varKeyVal = {
  sys: "#sys.",
  flow: "#flow.",
  order: "#order.",
  form: "#form.",
  user: "#user.",
  var: "#var."
};

export const PROP_CONST = {
  COMMON: {
    flowInstId: "flowInstId",
    code: "code",
    userRolePrefix: "ROLE_"
  },
  TEXT_DESC: {
    condSpELExplain:
      "当选择SpEL模式时, SpEL表达式必须符合SpEL格式, #anyKey表示表单的字段 ( 默认#form.前缀 ), 例如0<#days && #days>=3 ( 加前缀#var.anyKey表示从流程条件中取值，#user.anyKey表示从当前用户中取值 )",
    condUserExplain:
      "1、SpEL上下文表达式 ( 常用于发起时可确定办理人或角色的值 ), #anyKey表示表单的字段 ( 默认#form.前缀 ), 例如#userId ( 加前缀#var.anyKey表示从流程条件中取值，#user.anyKey表示从当前用户中取值 )",
    condMethodExplain1:
      "采用函数表达式 ( 以下两种方式均支持自定义任意扩展 ), 返回值为字符串 1 ( 满足 ) 或 0 ( 不满足 ), 满足您复杂条件的场景 :",
    condMethodExplain2:
      "1、SpEL上下文表达式, #anyKey表示表单的字段 ( 默认#form.前缀 ), 例如#isGoEnd ( 加前缀#var.anyKey表示从流程条件中取值，#user.anyKey表示从当前用户中取值 )",
    condMethodExplain3:
      "2、SpringBean函数表达式, 如某个Bean对象的beanName为bean，取值#bean.anyMethod(), 带参数格式#bean.anyMethod(String#admin,SysUser#{'username': 'admin'},SysRole#NULL)",
    condMethodExplain4:
      "备注：函数表达式 ( 参数支持SpEL上下文表达式且需带前缀如Long#form.userId ), 参数格式为#bean.anyMethod(参数类型#参数值), 多个参数逗号分割。类型为复杂对象时参数值为Json格式"
  },
  HANDOVER_FLOW: {
    userKey: {
      create_user: "create_user",
      receive_user: "receive_user",
      curr_dept_manager: "curr_dept_manager"
    }
  },
  SYS_FIELDS: [
    {
      prefix: varKeyVal.order,
      propId: "flowInstId",
      prop: "flowInstId",
      label: "流程实例ID",
      propType: "select",
      valueKey: "id",
      showKey: "flowName"
    },
    {
      prefix: varKeyVal.order,
      propId: "flowKey",
      prop: "flowKey",
      label: "流程业务KEY",
      propType: "input"
    },
    {
      prefix: varKeyVal.order,
      propId: "createUser",
      prop: "createUser",
      label: "发起人",
      propType: "select",
      valueKey: "userId",
      showKey: "name"
    },
    {
      prefix: varKeyVal.order,
      propId: "code",
      prop: "code",
      label: "工单编号",
      propType: "input"
    },
    {
      prefix: varKeyVal.order,
      propId: "createTime",
      prop: "createTime",
      label: "发起时间",
      propType: "input"
    },
    {
      prefix: varKeyVal.order,
      propId: "finishTime",
      prop: "finishTime",
      label: "完成时间",
      propType: "input"
    },
    {
      prefix: varKeyVal.order,
      propId: "_define_",
      prop: "_define_",
      label: "可自定义更多",
      propType: "input"
    }
  ],
  VAR_KEY_VAL: {
    person: "#person.",
    personName: "审批规则",
    link: "#link.",
    // 取值来源
    form: varKeyVal.form,
    user: varKeyVal.user,
    var: varKeyVal.var
  }
};
